project(LibNetImpl)

add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

find_package(OpenCV REQUIRED)
find_package(xtensor REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core)

add_library(${PROJECT_NAME}
    STATIC
        UNetOnnx.h
        UNetOnnx.cpp
)
target_link_libraries(${PROJECT_NAME}
        ${OpenCV_LIBS}
        ${onnxruntime_LIBS}
#        Qt6::Core
)
target_include_directories(${PROJECT_NAME}
    PUBLIC
        .
        ${OpenCV_INCLUDE_DIRS}
        ${onnxruntime_INCLUDE}
        ${xtensor_INCLUDE_DIRS}
        ${xtl_INCLUDE_DIRS}
)
set_target_properties(${PROJECT_NAME}
    PROPERTIES
        PUBLIC_HEADER UNetOnnx.h
)

include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
    PUBLIC_HEADER  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
